package xml;

import java.io.File;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;

public class ValidateXML {
	public static void main(String[] args) {
        File file = new File("C:/FILE/test.xml");
        if (file.exists()) {
            SAXBuilder builder = new SAXBuilder();
            builder.setValidation(true);
            try {
            	Document doc = (Document) builder.build(file);
            	Element root = doc.getRootElement();
            	System.out.println("StatusCode:"+root.getChildText("StatusCode"));
            	System.out.println("ResultCountTotal:"+root.getChildText("ResultCountTotal"));
            	System.out.println("ResultCount:"+root.getChildText("ResultCount"));
            	System.out.println("SUCCESS");
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            System.out.println("can not find xml file:"+ file.getAbsolutePath());
        }
    }
}
